﻿using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using nRoute.Controls;
using SimpleShell.ViewModels;
using SimpleShell.Views;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;
using SimpleShell.ViewServices;
using nRoute.Components;
using Windows.UI.Xaml.Media.Animation;


namespace SimpleShell
{
    /// <summary>
    /// An empty page that can be used on its own or navigated to within a Frame.
    /// </summary>
    public sealed partial class MainPage : Windows.UI.Xaml.Controls.Page, IMessageViewService
    {
        public MainPage()
        {
            this.InitializeComponent();
        }

        private void Button_Click_1(object sender, RoutedEventArgs e)
        {
            (((Button)sender).DataContext as nRoute.Components.IVisualCommand).Execute();
        }

        private void ViewServiceTypeRelay_Initialize_1(object sender, ValueEventArgs<object> e)
        {
            e.Value = typeof(IMessageViewService);
        }

#region IMessageViewService related

        void IMessageViewService.ShowMessage(string message)
        {
            this.MessageText.Text = message;
            ((Storyboard)this.Resources["MessageStoryboard"]).Begin();
        }

#endregion

    }
}
